package com.luckdraw.domain;

import java.util.Date;

import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.ColType;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Table;
import org.nutz.repo.Base64;

/**
 * 发红包记录流水
 * 
 * @author zhaoxiaobo
 *
 */
@Table("LuckDraw_WITHDRAWALLOG")
public class WithdrawalLog {

	/**
	 * 普通红包
	 */
	public static final String WITHDRAWAL_TYPE_REDPACK = "REDPACK";

	/**
	 * 企业付款
	 */
	public static final String WITHDRAWAL_TYPE_ENTERPRISE = "ENTERPRISE";

	/**
	 * id
	 */
	@Column("id")
	@ColDefine(type = ColType.VARCHAR, width = 36)
	private String id;

	/**
	 * 用户的openId
	 */
	@Column("openid")
	@ColDefine(type = ColType.VARCHAR, width = 36)
	private String openId;

	/**
	 * 提现方式
	 */
	@Column("withdrawal_type")
	@ColDefine(type = ColType.VARCHAR, width = 36)
	private String withdrawalType;

	/**
	 * 发红包的金额
	 */
	@Column("amount")
	@ColDefine(width = 36, precision = 0)
	private int amount;
	/**
	 * 发红包的状态 0成功 1失败
	 */
	@Column("state")
	@ColDefine(type = ColType.VARCHAR, width = 5)
	private String state;

	/**
	 * 错误编码
	 */
	@Column("err_code")
	@ColDefine(type = ColType.VARCHAR, width = 36)
	private String errCode;
	/**
	 * return_msg
	 */
	@Column("return_msg")
	@ColDefine(type = ColType.VARCHAR, width = 128)
	private String returnMsg;
	/**
	 * err_code_des
	 */
	@Column("err_code_des")
	@ColDefine(type = ColType.VARCHAR, width = 128)
	private String errCodeDes;

	/**
	 * crate_time
	 */
	@Column("crate_time")
	private Date crateTime;

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getReturnMsg() {
		return returnMsg;
	}

	public void setReturnMsg(String returnMsg) {
		this.returnMsg = returnMsg;
	}

	public String getReturnMsg2() {
		return new String(Base64.decode(returnMsg));
	}

	public void setReturnMsg2(String returnMsg) {
		this.returnMsg = Base64.encodeToString(returnMsg.getBytes(), false);
	}

	public String getErrCodeDes() {
		return errCodeDes;
	}

	public void setErrCodeDes(String errCodeDes) {
		this.errCodeDes = errCodeDes;
	}

	public String getErrCodeDes2() {
		return new String(Base64.decode(errCodeDes));
	}

	public void setErrCodeDes2(String errCodeDes) {
		this.errCodeDes = Base64.encodeToString(errCodeDes.getBytes(), false);
	}

	public Date getCrateTime() {
		return crateTime;
	}

	public void setCrateTime(Date crateTime) {
		this.crateTime = crateTime;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getWithdrawalType() {
		return withdrawalType;
	}

	public void setWithdrawalType(String withdrawalType) {
		this.withdrawalType = withdrawalType;
	}

	public String getErrCode() {
		return errCode;
	}

	public void setErrCode(String errCode) {
		this.errCode = errCode;
	}

}
